clear

global b;
global I;
global Kd;
%KArr = [0:0.000001:0.00001];
%K = KArr(1);
b = 0.02;
I = 0.004;

KArr = [0:0.001:0.2];
labels = {'k=10^-5','k=10^-4','k=10^-3','k=10^-2','k=10^-1','k=1', 'thetaR'};%,'k=15','k=20', 'Tout(t)'};

for i=1:length(KArr)
    Kd=KArr(i);
    [T Z]=rk4sgral(0,1000,[0,0],10000,'thetapuntoe');
    subT=T(1:500:length(T));
    subZ=Z(:,1);
    subZ=subZ(1:500:length(Z(:,1)));
    plot(subT, subZ);
    %, T', Z(:,2), 'b^'
    hold on;
end

ind=(1:length(labels));
plot(T, thetaR(T), 'r-');
%legend( labels{ind}, 'Location', 'NorthEastOutside');

xlabel('tiempo (s)');
ylabel('theta');

hold off;
axis([0,1000,0,10]);

%res(:,1), thetaR(res(:,1)), 'b-');